home *** CD-ROM | disk | FTP | other *** search
- Path: gramercy.ios.com!lalit
- From: lalit@gramercy.ios.com (lalit gidwani)
- Newsgroups: comp.lang.c++
- Subject: Re: Copying StdInput to StdOuput
- Date: 4 Jan 1996 02:09:20 GMT
- Organization: Internet Online Services
- Distribution: world
- Message-ID: <4cfcsg$keo@news2.ios.com>
- References: <CHN.96Jan3100905@alc.alc.ping.de>
- NNTP-Posting-Host: gramercy.ios.com
- X-Newsreader: TIN [version 1.2 PL2]
-
- Christian Neise (chn@alc.ping.de) wrote:
-
- : Hello!
-
- : Sorry for this newbie-question:
-
- : I want to write a filterprogramm under linux, which copies the
- : modified standardinput to standardouput.
-
- : I tried:
-
- : #include <iostream.h>
-
- : void main(){
- : char buf[200];
- : while (!cin.eof())
- : { cin >> buf; // or: cin.get(buf, 200, '\n');
- : cout << buf;
- : }
- : }
-
- : I compiled this as test and tried: cat AnyTextfile | test
- : and I expected to see AnyTextfile on the screen. But it
- : didn't work.
-
- : What's the problem?
-
- : Thanks in advance for any help!
-
- : Ciao,
- : Christian.
-
-
-
- :
- : --
- : Christian Neise
- : ---------------
- : email: chn@alc.ping.de phone: +49 - 231 - 751 95 22
- : pgp-fingerprint: DE B0 C8 EF 42 44 4F 50 2C 2E DC 19 F5 71 65 83
-